\documentclass[a4paper]{article}

\usepackage{pgfplots}

\usepgfplotslibrary{statistics}

\begin{document}
	\begin{tikzpicture}
	%\tracingmacros=2 \tracingcommands=2
		\begin{axis}[
		]
		\addplot+[
			boxplot prepared={
				lower whisker=5,
				lower quartile=7,
				median=8.5,
				upper quartile=9.5,
				upper whisker=10,
				draw position=\thisrow{pos},
			},
		]
		table[row sep=\\,y=v] {
	v pos\\
	1 4\\
	3 4\\
		};

		\end{axis}
	\end{tikzpicture}

	\begin{tikzpicture}
	%\tracingmacros=2 \tracingcommands=2
		\begin{axis}[
		]
		\addplot+[
			boxplot={
				draw position=\thisrow{pos},
			},
		]
		table[row sep=\\,y=v] {
	v pos\\
	1 4\\
	3 4\\
	5 4\\
	6 4\\
	7 4\\
	7 4\\
	7 4\\
	8 4\\
	8 4\\
	8 4\\
	9 4\\
	9 4\\
	9 4\\
	9 4\\
	9 4\\
	10 4\\
	10 4\\
	10 4\\
	10 4\\
	10 4\\
		};

		\end{axis}
	\end{tikzpicture}

\end{document}

